﻿package rd.hardcore.events 
{
	import flash.events.Event;
	import rd.hardcore.datas.Track;
	
	/**
	 * ...
	 * @author Thibault Perret
	 */
	public class TrackEvent extends Event 
	{
		static public const NEW_TRACK_GENERATED : String = "newTrackGenerated";
		
		public var track:Track;
		public var newPos:int;
		public var newChar:int;
		
		public function TrackEvent(type:String, _tracks:Track, _newPos:int = 0, _newChar:int = 0, bubbles:Boolean=false, cancelable:Boolean=false) 
		{ 
			super(type, bubbles, cancelable);
			track = _tracks;
			newChar = _newChar;
			newPos = _newPos;
		} 
		
		public override function clone():Event 
		{ 
			return new TrackEvent(type, track, newChar, newPos, bubbles, cancelable);
		} 
		
		public override function toString():String 
		{ 
			return formatToString("TrackEvent", "type", "track", "newChar", "newPos", "bubbles", "cancelable", "eventPhase"); 
		}
		
	}
	
}